﻿using System;

using FireBus.Contracts;


namespace FireBus.Isolation
{
	public class ExtensionAccessorAdapter : MarshalByRefObject, IExtensionAccessor
	{
		private readonly IExtensionAccessor _Accessor;


		public ExtensionAccessorAdapter(IExtensionAccessor accessor)
		{
			if (accessor == null)
			{
				throw new ArgumentNullException("accessor");
			}
			_Accessor = accessor;
		}


		public Object[] GetEventListeners(TypeName eventTypeName)
		{
			return _Accessor.GetEventListeners(eventTypeName);
		}

		public Object[] GetRequestListeners(TypeName requestTypeName, TypeName responseTypeName)
		{
			return _Accessor.GetRequestListeners(requestTypeName, responseTypeName);
		}

		public override Object InitializeLifetimeService()
		{
			return null;
		}
	}
}
